#ATAP线上构建shell脚本
#! /bin/bash
pwd
cd /home/atapfrontend/atap-frontend
docker-compose down
rm -rf docker-compose.yml
echo 'remove dist content'
cd persistence/html
rm -rf static index.html
echo 'uncompress dist&docker'
tar -zxvf /home/atapfrontend/dist.tar.gz -C /home/atapfrontend/atap-frontend
tar -zxvf /home/atapfrontend/docker.tar.gz -C /home/atapfrontend/atap-frontend
echo 'mv dist to persistence/html'
cd ../../dist
mv * -f /home/atapfrontend/atap-frontend/persistence/html
echo 'mv docker-compose.yml to persistence'
cd ../docker
mv docker-compose.yml -f /home/atapfrontend/atap-frontend
echo 'remove dist docker *.tar.gz'
cd ../
rm -rf dist docker
rm -rf /home/atapfrontend/*.tar.gz
docker-compose up -d